package cn.xx.a;

import java.util.Scanner;

public class Test2 {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        System.out.print("请输入被除数:");
        int num1 = in.nextInt();
        System.out.print("请输入除数:");
        //判斷除数是整数
        if (in.hasNextInt()){
            int num2 = in.nextInt();
            //判断是否是0
            if (num2 == 0){
                System.out.println("除数不能为0，重新输入");
                System.exit(1);
            }
            System.out.println(num1+"/"+ num2 +"="+ num1/ num2);
            System.out.println("感谢使用本程序！");
        }else{
            System.out.println("输入的除数不是整数，重新输入");
        }



    }
}
